#!/bin/sh
#
# $OpenBSD: knot.rc,v 1.4 2015/04/14 06:38:23 ajacoutot Exp $

daemon="${PREFIX}/sbin/knotd -d"
knotc="${PREFIX}/sbin/knotc"
knotcheckconf="${knotc} checkconf"

. /etc/rc.d/rc.subr

rc_pre() {
	install -d -o _knot -g wheel -m 750 /var/run/knot/
	${knotcheckconf}
}

rc_check() {
	${knotc} status
}

rc_reload() {
	${knotcheckconf} && ${knotc} reload
}

rc_stop() {
	${knotc} stop
}

rc_cmd $1
